package ai.zixing.mashibing.new_class.class02;

import java.util.Random;

public class RandToRand {
    public static void main(String[] args) {
        System.out.println((int)(Math.random() * 10));
        System.out.println(Math.max(Math.random(), Math.random()));
    }

    public static int f1() {
        return (int) (Math.random() * 5) + 1;
    }

    public static int f2() {
        int ans = 0;
        do {
            ans = f1();
        } while (ans == 3);
        return ans < 3 ? 0 : 1;
    }

    public static int f3() {
        return (f2() << 2) + (f2() << 1) + (f2() << 0);
    }

    public static int f4() {
        int ans = 0;
        do {
            ans = f3();
        } while (ans == 7);
        return ans;
    }
}
